﻿<%@ Page Language="C#" MasterPageFile="~/cp/admin/AdminMasterPage.master" AutoEventWireup="true" CodeBehind="adduser.aspx.cs" Inherits="E2_WEBSITE.cp.admin.user.adduser" Title="Thêm mới người dùng" %>

<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls"
    TagPrefix="BDP" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="body" runat="server">
    <asp:Table ID="container" runat="server" Width="100%">
        <asp:TableRow ID="TableRow1" runat="server">
            <asp:TableCell ID="TableCell1" runat="server" Width="20%">Tên đăng nhập</asp:TableCell>
            <asp:TableCell ID="TableCell2" runat="server" Width="80%">
                <asp:TextBox ID="tbLoginName" runat="server" Width="50%"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqLoginName" runat="server" ErrorMessage="Hãy nhập tên đăng nhập" ControlToValidate="tbLoginName"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow ID="TableRow2" runat="server">
            <asp:TableCell ID="TableCell3" runat="server" Width="20%">Mật khẩu</asp:TableCell>
            <asp:TableCell ID="TableCell4" runat="server" Width="80%">
                <asp:TextBox ID="tbPassword" runat="server" Width="30%" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqPassword" runat="server" ErrorMessage="Hãy nhập mật khẩu đăng nhập" ControlToValidate="tbPassword"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow3" runat="server">
            <asp:TableCell ID="TableCell5" runat="server" Width="20%">Xác nhận mật khẩu</asp:TableCell>
            <asp:TableCell ID="TableCell6" runat="server" Width="80%">
                <asp:TextBox ID="tbConfirmPassword" runat="server" Width="30%" TextMode="Password"></asp:TextBox>
                <asp:CompareValidator ID="cmpConfirmPassword" runat="server" ErrorMessage="Xác nhận mật khẩu không trùng khớp" ControlToCompare="tbPassword" ControlToValidate="tbConfirmPassword"></asp:CompareValidator>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow4" runat="server">
            <asp:TableCell ID="TableCell7" runat="server" Width="20%">Tên</asp:TableCell>
            <asp:TableCell ID="TableCell8" runat="server" Width="80%">
                <asp:TextBox ID="tbName" runat="server" Width="50%"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqName" runat="server" ErrorMessage="Hãy nhập tên của bạn" ControlToValidate="tbName"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow5" runat="server">
            <asp:TableCell ID="TableCell9" runat="server" Width="20%">Email</asp:TableCell>
            <asp:TableCell ID="TableCell10" runat="server" Width="80%">
                <asp:TextBox ID="tbEmail" runat="server" Width="50%"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqEmail" runat="server" ErrorMessage="Hãy nhập địa chỉ email" ControlToValidate="tbEmail"></asp:RequiredFieldValidator><br />
                <asp:RegularExpressionValidator ID="fmtEmail" runat="server" ErrorMessage="Email không hợp lệ" ControlToValidate="tbEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow6" runat="server">
            <asp:TableCell ID="TableCell11" runat="server" Width="20%">Địa chỉ</asp:TableCell>
            <asp:TableCell ID="TableCell12" runat="server" Width="80%">
                <asp:TextBox ID="tbAddress" runat="server" Width="100%"></asp:TextBox>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow7" runat="server">
            <asp:TableCell ID="TableCell13" runat="server" Width="20%">Giới tính</asp:TableCell>
            <asp:TableCell ID="TableCell14" runat="server" Width="80%">
                <asp:RadioButtonList ID="rblGender" runat="server" AutoPostBack="False">
                    <asp:ListItem Value="false">Nam</asp:ListItem>
                    <asp:ListItem Value="true">Nữ</asp:ListItem>
                </asp:RadioButtonList>

            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow8" runat="server">
            <asp:TableCell ID="TableCell15" runat="server" Width="20%">Ngày sinh</asp:TableCell>
            <asp:TableCell ID="TableCell16" runat="server" Width="80%">
                <BDP:BDPLite ID="dtpBirth" runat="server">
                </BDP:BDPLite>
                <BDP:DateRequiredValidator ID="reqBirth" runat="server" ErrorMessage="Hãy nhập ngày sinh của bạn vào" ControlToValidate="dtpBirth"></BDP:DateRequiredValidator>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow9" runat="server">
            <asp:TableCell ID="TableCell17" runat="server" Width="20%">Nghề nghiệp</asp:TableCell>
            <asp:TableCell ID="TableCell18" runat="server" Width="80%">
                <asp:TextBox ID="tbOccupation" runat="server" Width="30%"></asp:TextBox>
            </asp:TableCell>
        </asp:TableRow>
        
        <asp:TableRow ID="TableRow10" runat="server">
            <asp:TableCell ID="TableCell19" runat="server" Width="20%">Điện thoại</asp:TableCell>
            <asp:TableCell ID="TableCell20" runat="server" Width="80%">
                <asp:TextBox ID="tbPhone" runat="server" Width="30%"></asp:TextBox>
                <asp:RegularExpressionValidator ID="fmtPhone" runat="server" ErrorMessage="Số điện thoại chỉ được bao gồm số" ValidationExpression="\d*" ControlToValidate="tbPhone"></asp:RegularExpressionValidator>
            </asp:TableCell>
        </asp:TableRow>
     
        <asp:TableRow ID="TableRow11" runat="server">
            <asp:TableCell ID="TableCell21" runat="server" Width="20%">Loại người dùng</asp:TableCell>
            <asp:TableCell ID="TableCell22" runat="server" Width="80%">
                <asp:DropDownList ID="ddlType" runat="server" DataSourceID="oUserType" DataTextField="TenLoaiNguoiDung" DataValueField="ID">
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <asp:ObjectDataSource ID="oUserType" runat="server" SelectMethod="GetUserType" 
        TypeName="E2_WEBSITE.Code.Admin.UserController"></asp:ObjectDataSource>
    
    <center>
        <asp:Button ID="btnAccept" runat="server" Text="Chấp nhận" 
            onclick="btnAccept_Click" />
    </center>
</asp:Content>
<asp:Content ID="Content4" runat="server" contentplaceholderid="info">
Điền đầy đủ thông tin cần thiết để có thể thêm mới tài khoản vào cơ sở dữ liệu.
</asp:Content>

